package com.example.first;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class ScoreActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_score);
//        Button button1 = findViewById(R.id.bt1);
//        button1.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                int ou = Integer.parseInt(String.valueOf(out1.getText()));
//                String out = String.valueOf(ou+3);
//                out1.setText(out);
//            }
//        });
//        Button button2 = findViewById(R.id.bt2);
//        button2.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                int ou = Integer.parseInt(String.valueOf(out1.getText()));
//                String out = String.valueOf(ou+2);
//                out1.setText(out);
//            }
//        });
//        Button button3 = findViewById(R.id.bt3);
//        button3.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                int ou = Integer.parseInt(String.valueOf(out1.getText()));
//                int m = ou+1;
//                String out = String.valueOf(m);
//                out1.setText(out);
//            }
//        });
//        Button button4 = findViewById(R.id.bt4);
//        button4.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                out1.setText("0");
//            }
//        });

    }
    public void myclick(View btn){
        TextView out1 = findViewById(R.id.tv2);
        if(btn.getId()==R.id.bt1){
            int ou = Integer.parseInt(String.valueOf(out1.getText()));
            String out = String.valueOf(ou+3);
            out1.setText(out);
        }else if(btn.getId()==R.id.bt2){
            int ou = Integer.parseInt(String.valueOf(out1.getText()));
            String out = String.valueOf(ou+2);
            out1.setText(out);
        }else if(btn.getId()==R.id.bt3){
            int ou = Integer.parseInt(String.valueOf(out1.getText()));
            String out = String.valueOf(ou+1);
            out1.setText(out);
    }else if(btn.getId()==R.id.bt4){
            out1.setText("0");
        }
    }
}